#!/bin/bash
wget -O /tmp/NotoColorEmoji.ttf https://github.com/googlefonts/noto-emoji/raw/main/fonts/NotoColorEmoji.ttf || error "Failed to download NotoColorEmoji.ttf!"

sudo mkdir -p /usr/local/share/fonts || error "Failed to create /usr/local/share/fonts folder!"
sudo mv /tmp/NotoColorEmoji.ttf /usr/local/share/fonts

fc-cache -f || sudo fc-cache -fv || error "Failed to run fc-cache!"

#get large support for other symbols like the ones used in pi-apps terminal logo
install_packages fonts-noto-core || exit 1

#remove problematic package which overrides notocoloremoji and makes chromium render in black and white
if package_installed fonts-twemoji-svginot ;then
  sudo apt-get purge -y fonts-twemoji-svginot || true
fi
